package light.head.model.el;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Formula;
/**
 * 班级表
 */
@Table
@Entity
public class Classes implements Serializable{

	
	private static final long serialVersionUID = 6900580447821533026L;
	
	private Integer code;
	private String name;			// 班级名称
	private Date startSignTime;		// 开始报名时间
	private Date endSignTime;		// 结束报名时间
	private Byte how;			// 报名方式(1.无需审核 2.需要审核 3.自选)
	private Short num;				// 报名限制人数
	private Date beginTime;			// 开班时间
	private Date finishTime;		// 班级结束时间
	private	Boolean isFront;		// 是否前置
	private Integer oc;				// 创建机构
	private Integer cu;				// 创建人
	private Date ct;				// 创建时间
	private Boolean deleted;		// 是否删除
	
	private String cn;				// 创建人
	private String on;
	private List<ClassesCourseRelation> ccrList; // 班级课程关系
	private List<UserClassesRelation> ucrList;	 // 学生班级关系
	private List<ClassCourseTopicRelation> cctrList;//班级课程题目指定表
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column
	public Integer getCode() {
		return code;
	}
	@Column
	public String getName() {
		return name;
	}
	@Column
	public Date getStartSignTime() {
		return startSignTime;
	}
	@Column
	public Date getEndSignTime() {
		return endSignTime;
	}
	@Column
	public Byte getHow() {
		return how;
	}
	@Column
	public Short getNum() {
		return num;
	}
	@Column
	public Date getBeginTime() {
		return beginTime;
	}
	@Column
	public Date getFinishTime() {
		return finishTime;
	}
	@Column
	public Boolean getIsFront() {
		return isFront;
	}
	@Column
	public Integer getOc() {
		return oc;
	}
	@Column
	public Integer getCu() {
		return cu;
	}
	@Column
	public Date getCt() {
		return ct;
	}
	@Column
	public Boolean getDeleted() {
		return deleted;
	}
	@Formula("(SELECT u.realName FROM UserInfo u WHERE u.code=cu)")
	public String getCn() {
		return cn;
	}
	@Formula("(SELECT o.name FROM Organ o WHERE o.code=oc)")
	public String getOn() {
		return on;
	}
	
	@Transient
	public List<ClassesCourseRelation> getCcrList() {
		return ccrList;
	}
	@Transient
	public List<UserClassesRelation> getUcrList() {
		return ucrList;
	}
	@Transient
	public List<ClassCourseTopicRelation> getCctrList() {
		return cctrList;
	}
	
	
	
	public void setCcrList(List<ClassesCourseRelation> ccrList) {
		this.ccrList = ccrList;
	}
	public void setUcrList(List<UserClassesRelation> ucrList) {
		this.ucrList = ucrList;
	}
	public void setCctrList(List<ClassCourseTopicRelation> cctrList) {
		this.cctrList = cctrList;
	}
	public void setCode(Integer code) {
		this.code = code;
	}
	public void setName(String name) {
		this.name = name;
	}
	public void setStartSignTime(Date startSignTime) {
		this.startSignTime = startSignTime;
	}
	public void setEndSignTime(Date endSignTime) {
		this.endSignTime = endSignTime;
	}
	public void setHow(Byte how) {
		this.how = how;
	}
	public void setNum(Short num) {
		this.num = num;
	}
	public void setBeginTime(Date beginTime) {
		this.beginTime = beginTime;
	}
	public void setFinishTime(Date finishTime) {
		this.finishTime = finishTime;
	}
	public void setIsFront(Boolean isFront) {
		this.isFront = isFront;
	}
	public void setOc(Integer oc) {
		this.oc = oc;
	}
	public void setCu(Integer cu) {
		this.cu = cu;
	}
	public void setCt(Date ct) {
		this.ct = ct;
	}
	public void setDeleted(Boolean deleted) {
		this.deleted = deleted;
	}
	public void setCn(String cn) {
		this.cn = cn;
	}
	public void setOn(String on) {
		this.on = on;
	}
	
	
	

}
